package it.xiuxian.personcenter.presenter

import com.lzy.okgo.OkGo
import it.xiuxian.lib.base.BaseBean
import it.xiuxian.lib.base.BasePresenter
import it.xiuxian.lib.base.ILoadBind
import it.xiuxian.lib.http.CallBackOption
import it.xiuxian.lib.http.HttpConfig
import it.xiuxian.personcenter.activity.GongXianZhiActivity
import it.xiuxian.personcenter.bean.WalletDetailBean

class GongXianZhiActivityPresenter:BasePresenter<GongXianZhiActivity>(){
    fun getRecord(){
        OkGo.post<BaseBean<WalletDetailBean>>(HttpConfig.BASE_URL+"/appuser/getMoney")
            .execute(object : CallBackOption<BaseBean<WalletDetailBean>>() {}.loadBind(mView as GongXianZhiActivity).execute(
                object : ILoadBind<BaseBean<WalletDetailBean>> {
                    override fun excute(bean: BaseBean<WalletDetailBean>) {
                        if(bean.code==0){
                            (mView as GongXianZhiActivity).setGongXian(bean.data)
                        }
                    }
                }
            ))
    }
}